﻿using System.Configuration;
using System.Net;
using System.Web.Mvc;

namespace Citi.PTSConsolidation.WebUi.Controllers
{
    public class SchedulerController : Controller
    {
        private string ScheduleOnDemandUrl = ConfigurationManager.AppSettings["ScheduleOnDemandUrl"];

        public ActionResult ScheduleRoutine(int routineId)
        {
            var username = ConfigurationManager.AppSettings["NetworkUser"];
            var password = ConfigurationManager.AppSettings["NetworkPassword"];
            var proxy = ConfigurationManager.AppSettings["Proxy"];

            try
            {
                var request = (HttpWebRequest)WebRequest.Create(string.Format(ScheduleOnDemandUrl, routineId));
                request.Credentials = new NetworkCredential(username, password, "lac");
                request.GetResponse();
            }
            catch { }

            return View();
        }
    }
}
